package com.zpc.rabbitmq.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * 消息交换机配置    可以配置多个
 * @author Dhjie
 *
 */

@Configuration
public class QueueConfig {
	
	@Bean
	public Queue testQueue() {
		return new Queue(MqConfig.QUEUE_NAME, true, false, false);
	}
	@Bean
	public Queue testQueue001() {
		return new Queue(MqConfig.QUEUE_TEST_NAME,true,false,false);
	}
	@Bean
	public Queue queueFanout001(){
		return new Queue(MqConfig.QUEUE_TEST_FANOUT001);
	}
	@Bean
	public Queue queueFanout002(){
		return new Queue(MqConfig.QUEUE_TEST_FANOUT002);
	}

	/*@Bean
	public FanoutExchange fanoutExchange() {
		return new FanoutExchange(MqConfig.EXCAHNGE_FANOUT_NAME);
	}*/
	
	
	
	/*@Bean
	public Binding fanoutExchange001(@Qualifier("queueFanout001") Queue queueFanout001,FanoutExchange fanoutExchange) {
		return BindingBuilder.bind(queueFanout001).to(fanoutExchange());
	}

	@Bean
	Binding fanoutExchange002(@Qualifier("queueFanout002") Queue queueFanout002,FanoutExchange fanoutExchange) {
		return BindingBuilder.bind(queueFanout002).to(fanoutExchange());
	}*/
}
